package yhao.infra.feature.aliyun.oss.core;

import yhao.infra.feature.aliyun.oss.AliyunOssProperties;
import yhao.infra.feature.aliyun.oss.core.response.AliyunOssBaseResponse;

/**
 * @author yoara
 * <p> Created on 2019/9/25 </p>
 */
public abstract class AliyunOssBaseRequest<T extends AliyunOssBaseResponse> {
    protected BucketInfo protectBucket;
    protected BucketInfo fileBucket;
    protected AliyunOssProperties aliyunOssProperties;

    public T doRequest(AliyunOssComponent aliyunOssComponent){
        protectBucket = aliyunOssComponent.getProtectBucket();
        fileBucket = aliyunOssComponent.getFileBucket();
        aliyunOssProperties = aliyunOssComponent.getAliyunOssProperties();
        return doRequest();
    }

    protected abstract T doRequest();
}
